tinymce.PluginManager.add("leanote_nav",function(a){function b(){var b=a.getBody(),d=$(b),e=d.html();if(c!=e){c=e;for(var f=d.find("h1,h2,h3,h4,h5,h6").toArray(),g="<ul>",h=0;h<f.length;++h){var i=$(f[h]).text(),j=f[h].tagName.toLowerCase();g+='<li class="nav-'+j+'"><a data-a="'+j+"-"+encodeURI(i)+'" onclick="window.scrollTo(this, \''+j+"', '"+i+"')\">"+i+"</a></li>"}g+="</ul>",$("#leanoteNavContent").html(g).height("auto"),f.length||$("#leanoteNavContent").html("&nbsp; Nothing...");var k=$("#leanoteNavContent").height(),l=$("#editorContent").height()-29;k>l&&$("#leanoteNavContent").height(l)}}var c="";a.on("init",function(){window.setTimeout(function(){b(),a.on("setcontent beforeadd undo paste",b),a.on("ExecCommand",function(a){b()}),a.on("click",function(a){b(),$("body").trigger("click")})},0)})});